#ifndef TRAYICON_H
#define TRAYICON_H

#include <QWidget>
#include <QMenu>
#include <QSystemTrayIcon.h>


class trayicon 
{
	
public:
	trayicon(QWidget *parent = 0);

	void initIcon()
	{
		_icon[0]=QIcon("./images/bad.svg");
		_icon[1]=QIcon("./images/heart.svg");
		_icon[2]=QIcon("./images/trash.svg");

		_toolTip[0]=tr("./images/bad.svg");
		_toolTip[1]=tr("./images/heart.svg");
		_toolTip[2]=tr("./images/trash.svg");
	}
	~trayicon();
	void createTrayIcon();
	void createActions();
	void setIcon(int index);
private slots:
	void iconActivated(QSystemTrayIcon::ActivationReason reason);
	void showMessage();
	void messageClicked();
private:
	Ui::trayiconClass ui;

	QAction *minimizeAction;
	QAction *maximizeAction;
	QAction *restoreAction;
	QAction *quitAction;

	QMenu * trayIconMenu;
	QSystemTrayIcon* trayIcon;
	QIcon  _icon[5];
	QString _toolTip[5];
};

#endif // TRAYICON_H
